package com.neusoft.work.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neusoft.work.dao.DishDao;
import com.neusoft.work.po.Dish;
import com.neusoft.work.po.PageResponseBean;
import com.neusoft.work.po.ResponseBean;
import com.neusoft.work.service.DishService;

@Service
public class DishServiceImpl implements DishService {
    @Autowired
    private DishDao dishDao;


    @Override
    public ResponseBean<List<Dish>> queryDish() {
        List<Dish> list=dishDao.selectList(null);
        ResponseBean<List<Dish>> rb = new PageResponseBean<>(list);
        return rb;
    }


	@Override
	public ResponseBean<Dish> queryDishById(Integer id) {
		// TODO Auto-generated method stub
		Dish dish=dishDao.selectById(id);
		if(dish!=null) {
			return new PageResponseBean<>(dish);
		}else {
			return new PageResponseBean<>(500,"无数据");
		}
	}
}
